<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>取得 MySQL 服务器信息</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mysql-get-proto-info.html">mysql_get_proto_info</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mysql-info.html">mysql_info</a></div>
 <div class="up"><a href="ref.mysql.html">MySQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.mysql-get-server-info" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">mysql_get_server_info</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5)</p><p class="refpurpose"><span class="refname">mysql_get_server_info</span> &mdash; <span class="dc-title">取得 MySQL 服务器信息</span></p>

   </div>
   <div class="refsect1 unknown-unknown-unknown-unknown-seealss" id="refsect1-function.mysql-get-server-info-unknown-unknown-unknown-unknown-seealss">
    <h3 class="title">说明</h3>
    <div class="methodsynopsis dc-description">
     <span class="type">string</span> <span class="methodname"><strong>mysql_get_server_info</strong></span>
      ([ <span class="methodparam"><span class="type">resource</span> <code class="parameter">$link_identifier</code></span>
    ] )</div>

    <p class="para rdfs-comment">
     <span class="function"><strong>mysql_get_server_info()</strong></span> 返回
     <em><code class="parameter">link_identifier</code></em>
     所使用的服务器版本。如果省略
     <em><code class="parameter">link_identifier</code></em>，则使用上一个打开的连接。
    </p>
    <p class="para">
     <div class="example" id="example-1571">
      <p><strong>Example #1 <span class="function"><strong>mysql_get_server_info()</strong></span> 例子</strong></p>
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;mysql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"mysql_user"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"mysql_password"</span><span style="color: #007700">)&nbsp;or<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #DD0000">"Could&nbsp;not&nbsp;connect:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"MySQL&nbsp;server&nbsp;version:&nbsp;%s\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">mysql_get_server_info</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
      </div>

      <div class="example-contents"><p>
       以上例子将产生如下输出：
      </p></div>
      <div class="example-contents screen">
<div class="cdata"><pre>
MySQL server version: 4.0.1-alpha
</pre></div>
      </div>
     </div>
    </p>
    <p class="para">
     参见
     <span class="function"><a href="function.mysql-get-client-info.html" class="function">mysql_get_client_info()</a></span>，<span class="function"><a href="function.mysql-get-host-info.html" class="function">mysql_get_host_info()</a></span> 和
     <span class="function"><a href="function.mysql-get-proto-info.html" class="function">mysql_get_proto_info()</a></span>。
    </p>
   </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mysql-get-proto-info.html">mysql_get_proto_info</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mysql-info.html">mysql_info</a></div>
 <div class="up"><a href="ref.mysql.html">MySQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
